package com.example.demo;

import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController
public class UserController {
    @RequestMapping("/sayHi")
    public String sayHi(){
        return "hello,Spring MVC";
    }

    //只支持get
    @RequestMapping(value ="/sayHi1",method = RequestMethod.GET)//GetMapping
    public String sayHi1(){
        return "hello,Spring MVC1";
    }

    //只支持post
    @RequestMapping(value ="/sayHi2",method = RequestMethod.POST)//POSTmapping
    public String sayHi2(){
        return "hello,Spring MVC2";
    }

    //只支持get
    @GetMapping("/sayHi3")
    public String sayHi3(){
        return "hello,Spring MVC3";
    }

    //只支持post
    @PostMapping("/sayHi4")
    public String sayHi4(){
        return "hello,Spring MVC4";
    }




}